project(zlog_test)

set(EXE_NAME "zlog_test")

set(POSTFIX "")

add_executable(${EXE_NAME} main.cxx)

if(MSVC)

set_target_properties(${EXE_NAME} PROPERTIES
    DEBUG_POSTFIX "${POSTFIX}D"
    RELEASE_POSTFIX "${POSTFIX}"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    )

else()

set_target_properties(${EXE_NAME} PROPERTIES
    DEBUG_POSTFIX "${POSTFIX}D"
    RELEASE_POSTFIX "${POSTFIX}"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib"  # 安装时设置target中的RPATH路径，解决无法找到libzpsoe.so的问题
    )

endif()

target_link_libraries(${EXE_NAME} zpsoe_zlog)

install(TARGETS ${EXE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)